import Command from "./command"
export class ScheduleTaskCommand extends Command {
  constructor(e: any, task: () => any, maxDelay: any) {
    super()
    this.id = "SCHEDULE_TASK_COMMAND"
    const func = (function* () {
      return task()
    })()
    this.payload = { type: e, func, maxDelay, steps: 1 }
  }
}
export class ScheduleProcessCommand extends Command {
  constructor(type: any, func: any, maxDelay: any, steps = 1) {
    super()
    this.id = "SCHEDULE_PROCESS_COMMAND"
    this.payload = { type, func, maxDelay, steps }
  }
}
